public class PhoneFormat
{
  
  public static void main (String args[]) 
  {
    
    String p = args[0];
    if(p.length() == 10)
      System.out.println( "(" + p.substring(0,3) + ") " +  p.substring(3,6) + "-" + p.substring(6,10));
    else if(p.length() == 7)
      System.out.println( p.substring(0,3) + "-" + p.substring(3,7));
    else
      System.out.println(p);
    
  }
  
  
}